package com.gimi.cloud.bbp.dao.myMapper.core.provider.update.aes;

import com.gimi.cloud.bbp.dao.myMapper.core.JrcsSqlHelper;
import org.apache.ibatis.mapping.MappedStatement;

import tk.mybatis.mapper.mapperhelper.MapperHelper;
import tk.mybatis.mapper.mapperhelper.MapperTemplate;
import tk.mybatis.mapper.mapperhelper.SqlHelper;

/**
 * 通用更新方法
 * 
 * @author wbj
 *
 */
public class JrcsAesUpdateProvider extends MapperTemplate {

	public JrcsAesUpdateProvider(Class<?> mapperClass, MapperHelper mapperHelper) {
		super(mapperClass, mapperHelper);
	}

	public String baseAesUpdateByPrimaryKey(MappedStatement ms) {
		Class<?> entityClass = getEntityClass(ms);
		StringBuilder sql = new StringBuilder();
		sql.append(SqlHelper.updateTable(entityClass, tableName(entityClass)));
		sql.append(JrcsSqlHelper.updateAesSetColumns(entityClass, null, false, false));
		sql.append(SqlHelper.wherePKColumns(entityClass));
		return sql.toString();
	}
}
